home *** CD-ROM | disk | FTP | other *** search
- Path: digital.netvoyage.net!not-for-mail
- From: abu@digital.netvoyage.net (Abu Wawda)
- Newsgroups: comp.lang.c++
- Subject: Anyone Using g++ With C++ Templates?
- Date: 25 Feb 1996 23:11:54 -0800
- Organization: NetVoyage
- Message-ID: <4grmfq$cs7@digital.netvoyage.net>
- NNTP-Posting-Host: digital.netvoyage.net
- X-Ident: abu
- X-Warning: X-Ident uses identd and is subject to forgery. Be careful.
-
-
- I simply can't get my files to compile with g++, so please help. I have
- this problem only with C++ programs using templates. I have three files:
- list.h, list.C, and sample.C. list.h contains the declarations for my list
- class (which uses templates). list.C includes list.h and implements the
- class. sample.C includes list.h and is a sample that creates a list object
- and does a few things with it. This is how I compile them:
-
- g++ -c sample.C
- g++ -c list.C
- g++ sample.o list.o
-
- The first two commands give no errors whatsoever. But when I try to link the
- two object files together on the third line I get this:
-
- sample.o: Undefined symbol `___t4List1Zi' referenced from text segment
- sample.o: Undefined symbol `_Insert__t4List1Zii' referenced from text segment
- sample.o: Undefined symbol `_PrintList__t4List1Zi' referenced from text segment
- sample.o: Undefined symbol `_Delete__t4List1Zii' referenced from text segment
- sample.o: Undefined symbol `_Find__t4List1Zii' referenced from text segment
- sample.o: Undefined symbol `__$_t4List1Zi' referenced from text segment
-
- Why? Please help, I simply can't figure this out. Thanks in advance,
-
- Abu Wawda
- abu@netvoyage.net
- --
- ---------------------------------------------------------------------------
- Abu Wawda | abu@netvoyage.net | Live Long
- | http://www.netvoyage.net/abu | And Prosper.
- ---------------------------------------------------------------------------
-